package com.github.data_manage.domain.po

import cn.idev.excel.annotation.ExcelIgnore
import cn.idev.excel.annotation.ExcelProperty
import com.fasterxml.jackson.annotation.JsonIgnore
import com.github.data_manage.util.LocalDateConvert
import io.swagger.v3.oas.annotations.media.Schema
import io.swagger.v3.oas.annotations.media.SchemaProperty
import jakarta.persistence.*
import org.hibernate.annotations.SQLRestriction
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters
import org.springframework.format.annotation.DateTimeFormat
import java.math.BigDecimal
import java.time.LocalDate
import kotlin.jvm.Transient

/**
 *@author CHN
 *@since 2024-08-07 21:58
 */
@Entity
@Table(name = "t_companies", uniqueConstraints = [UniqueConstraint(columnNames = ["companyName"])])
@Schema(description = "公司")
open class Company: AbstractModifyPo() {

    @Id
    @Column(name = "company_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ExcelIgnore
    open var companyId: Int? = null

    // "公司名称")
    @ExcelProperty("公司名称", index = 0)
    open var companyName: String? = null

    // "成立时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ExcelProperty("成立时间", index = 1)
    open var createTime: String? = null

    // "公司策略")
    @ExcelProperty("公司策略", index = 2)
    open var policy: String? = null

    // "管理规模（百万美金）")
    @ExcelProperty("管理规模（百万美金）", index = 3)
    open var aum: BigDecimal? = null

    @ExcelProperty("公司城市",index = 4)
    open var companyCity: String? = null

    // "公司地址")
    @ExcelProperty("公司地址", index = 5)
    open var companyAddress: String? = null

    // "公司类型")
    @ExcelProperty("公司类型", index = 6)
    open var companyType: String? = null

    // "是否有seeder")
    @ExcelProperty("是否有seeder", index = 7)
    open var hasSeeder: String? = null

    // "是否有sma")
    @ExcelProperty("是否有sma", index = 8)
    open var hasSma: String? = null

    // "qpam")
    @ExcelProperty("qpam", index = 9)
    open var qpam: String? = null

    // "sfc注册")
    @ExcelProperty("sfc注册", index = 10)
    open var sfc: String? = null

    // "公司产品")
    @ExcelProperty("公司产品", index = 11)
    open var product: String? = null

    // "联系姓名")
    @ExcelProperty("联系姓名", index = 12)
    open var contactName: String? = null


    @ExcelProperty("联系人职位", index = 13)
    open var contactPosition: String? = null

    // "联系电话")
    @ExcelProperty("联系电话", index = 14)
    open var contactPhone: String? = null

    // "联系邮箱")
    @ExcelProperty("联系邮箱", index = 15)
    open var contactEmail: String? = null

    @ExcelProperty("公司领英主页", index = 16)
    open var linkedUrl: String? = null

    @ExcelProperty("公司网站", index = 17)
    open var companyWebSite: String? = null

    // "备注")
    @ExcelProperty("备注", index = 18)
    open var note: String? = null

    // "投资地区")
    @ExcelIgnore
    open var area: String? = null

    // 投资人/股东
    @Transient
    open var companyShareholders: List<CompanyShareholder>? = null

    // 股东备注
    @ExcelProperty("股东备注", index = 19)
    open var companyShareholdersNote: String? = null

    @ExcelProperty("录入人", index = 20)
    open var insertBy: String? = null



    @JsonIgnore
    override fun getId(): Int? = this.companyId
}
